// warehouse.js
import request from '@/utils/request'

// 仓库管理
export function getAllWarehouses() {
    return request({
        url: '/api/warehouse',
        method: 'get'
    })
}

export function getWarehouseById(id) {
    return request({
        url: `/api/warehouse/${id}`,
        method: 'get'
    })
}

export function addWarehouse(data) {
    return request({
        url: '/api/warehouse',
        method: 'post',
        data
    })
}

export function updateWarehouse(data) {
    return request({
        url: '/api/warehouse',
        method: 'put',
        data
    })
}

export function deleteWarehouse(id) {
    return request({
        url: `/api/warehouse/${id}`,
        method: 'delete'
    })
} 